<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%String basePath = request.getContextPath(); %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>任务管理</title>
<script type="text/javascript" src="<%=basePath%>/resource/js/constants.js"></script>
<script type="text/javascript" src="<%=basePath%>/resource/js/ajax_constants.js"></script>
<script type="text/javascript" src="<%=basePath%>/resource/js/jquery/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=basePath%>/resource/js/honeycombtool.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#addStaffSubmitButton").click(submitStaff);
	});
	function submitStaff() {
		var staffName = $("#staffName").val();
		var explain = $("#explain").val();
		var actionId = $("#actionId").val();
		//if (staffName && explain && actionId && "" != staffName && "" != explain && "" != actionId) {
		if (!CHECK.isEmpty(staffName) && !CHECK.isEmpty(explain) && !CHECK.isEmpty(actionId)) {	
			$.ajax({
				url: WEBROOT+"/play/dine/admin/ajaxAddStaff",
				type: "post",
				dataType: "json",
				data: {"staffName": staffName,
					"explain": explain,
					"actionId": actionId
				},
				success: function(res) {
					if (res.result == AjaxMsgConstants.SUCCESS) {
						alert("添加任务成功");
					} else {
						alert("添加任务失败");
					}
				}
			});
		} else {
			alert("请先完善数据");
		}
	}
</script>
</head>
<body>
	<div>
		任务名:<input type="text" id="staffName" />
	</div>
	<div>
		任务简介:<input type="text" id="explain" />
		<input type="hidden" id="actionId" value="<%=request.getAttribute("actionId") %>" />
	</div>
	<div>
		<input type="button" id="addStaffSubmitButton" value="添加" />
	</div>
	<div style="clear: both;"></div>
</body>
</html>